package com.fengpb.friday.conductor.common.dto;

public class Response<T> {

    private int status;

    private String message;

    private T data;

    private long timestamp;

    private String path;

    public Response() {}

    public Response(HttpStatusEnum statusEnum) {
        this(statusEnum, null);
    }

    public Response(HttpStatusEnum statusEnum, T data) {
        this(statusEnum, data, null);
    }

    public Response(HttpStatusEnum statusEnum, T data, String path) {
        this.status = statusEnum.status();
        this.message = statusEnum.message();
        this.data = data;
        this.timestamp = System.currentTimeMillis();
        this.path = path;
    }

    public Response(int status, String message) {
        this.status = status;
        this.message = message;
        this.timestamp = System.currentTimeMillis();
    }

    public Response(int status, String message, String path) {
        this.status = status;
        this.message = message;
        this.timestamp = System.currentTimeMillis();
        this.path = path;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
